<template>
  <BasicTable
    @register="registerTable"
  >
    <template #form-custom></template>

  </BasicTable>
  <!--注册drawer  -->
</template>

<script lang="ts" setup>
import {defineComponent, ref, onMounted} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {getBasicColumns, getFormConfig} from './data';
//左侧拉板
import {useDrawer} from '/@/components/Drawer';

import {message} from 'ant-design-vue';
import {
  getStatisticsApi
} from "/@/api/sys/sysZhengShuApi";

const [registerDrawer, {openDrawer}] = useDrawer();

const [registerTable, {reload, getForm, setTableData, setPagination, setLoading}] = useTable({
  title: '学习统计',
  columns: getBasicColumns(),
  useSearchForm: true,
  formConfig: getFormConfig(),
  showTableSetting: true,
  rowKey: 'id',
  bordered: true,
  showIndexColumn: true,

  api: getStatisticsApi,
  fetchSetting: {
    pageField: 'current',
    // 每页显示多少条
    sizeField: 'pageSize',
    // 请求结果列表字段  支持 a.b.c
    listField: 'records',
    totalField: 'total',

  },
});

function handleCreate() {
  openDrawer(true, {
    isUpdate: false,
  });
}

function handleSuccess() {
  reload();
}

onMounted(() => {
});


</script>
